<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="/html/js/axios.min.js"></script>
    <script src="/html/js/ajax.js"></script>
    <script src="/html/js/layui.js"></script>
    <script src="/html/js/util.js"></script>
    <link rel="stylesheet" href="/html/js/css/layui.css" media="all">
    <title>购买成功</title>
</head>

<script type="text/javascript">
    let time = 3; //时间,秒
    function Redirect() {
        location.href = "/html/index.html";
    }

    let i = 0;

    function dis() {
        document["all"].s.innerHTML = (time - i) + "秒后跳转至首页";
        i++;
    }

    timer = setInterval('dis()', 1000); //显示时间
    timer = setTimeout('Redirect()', time * 1000); //跳转
</script>
<body style="padding-top: 50px;display: flex;justify-content: center">
<div>
    <h1>购买成功</h1>
    <div id="s"></div>
</div>
</body>
</html>